"IOError [Errno 13] Permisson denied" when copy a file on Windows
Posted
by
wong2
on Stack Overflow
See other posts from Stack Overflow
or by wong2
Published on 2011-01-17T13:20:28Z
Indexed on
2011/01/17
13:53 UTC
Read the original article
Hit count: 139
Hi, I wrote a program that will copy a file called a.exe to C:/Windows/
, then I pack it to exe with PyInstaller, and rename the exe file to a.exe. When I run the exe file, it output IOError [Errno 13] Permisson denied: 'C:/Windows/a.exe'
, but the file a.exe
was copied to the directory C:/Windows
. Then I ran it as the Administrator, it happened again...
At first, I copy the file with shututil.copy
, then I wrote a function myself(open a.exe, create a.exe under C:/Windows, read a.exe 's content and write to C:/Windows/a.exe, close all), but it doesn't help...Any ideas?
© Stack Overflow or respective owner